package cn.legend.travel.admin.user.dao.persist.repository.impl;

import cn.legend.travel.admin.user.dao.persist.mapper.ChatMapper;
import cn.legend.travel.admin.user.dao.persist.repository.IChatRepository;
import cn.legend.travel.admin.user.pojo.entity.Chat;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@Repository
@RequiredArgsConstructor
public class ChatRepositoryImpl implements IChatRepository {
    private final ChatMapper mapper;

    @Override
    public int sendWarnings(Long id, String message) {
        Chat chat = new Chat();
        chat.setContent(message);
        chat.setIsRead(0);
        chat.setSenderId(1L);
        chat.setReceiverId(id);
        return mapper.insert(chat);
    }
}
